exports.getInvitationCode = function(req,res){
    
    var bodyParams = req.routeInfo.bodyParams;

    //将OPENID中出现的- 替换为*
    bodyParams.openid = bodyParams.openid.replace(/\-/g,"*")

    var resultData = []

    async.waterfall([

        //获取该用户的最后一条访问记录
        function(cb){

            if(bodyParams.openid == 0){
                return cb();
            }
           
            R.SEND_HTTP(
                req,
                {
                    url    : CORE_APIConfig.coreAPI.organizationSearchArtProductUserReadRecord + "/apurr_openid/" + bodyParams.openid + "/sort_order/apurr_create_time-desc/skip/0/limit/1",
                    method : 'POST',
                    data : {
                        fields : "apurr_uid"
                    }
                },
                function (err, data) {

                    resultData = data.data;
                    
                    cb();
                    
                }
            );
        }

    ],function(err, result){

        //返回最终拼接结果
        RES.response(res,true,resultData);

    });

}